@import "../common/vars.scss";
@import "../mixins/mixins.scss";
@include create(dialog){
    position: fixed;
    background:$dialog-backgroud;
    border-radius:$dialog-border-radius;
    box-shadow:$box-shadow-base;
    box-sizing: border-box;
    z-index: $index-popper+2;
    width: 50%;
    @include m(header){
        padding:$dialog-header-padding;
        cursor: move;
    }
    @include m(title){
        padding-left: 0;
        margin-bottom: 0;
        font-size: $font-size-base+2;
        line-height: 1;
        color: $color-text-primary;
    }
    @include m(close){
        position: absolute;
        top: 15px;
        right: 15px;
        padding: 0;
        background: transparent;
        border: none;
        outline: none;
        cursor: pointer;
        font-size: $font-size-base+2;
        color: $color-text-regular;
        &:hover{
            color: $color-primary;
        }
    }
    @include m(footer){
        padding: $dialog-header-footer;
        text-align: right;
        box-sizing: border-box;
        &::after{
          content: "";
          display:block;
          clear: both;
        }
        &.left>button{
          float: left;
        }
        &.center{
          text-align: center;
        }
    }

    @include m(modal){
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        opacity: .5;
        background: $color-black;
        z-index: $index-popper+2;
    }

    @include m(body){
        display: block;
        padding: $dialog-content-padding;
        color: $color-text-regular;
        font-size: $font-size-base;
    }
    iframe{
        width: 100%;
    }
}

@include create(message-box){
    max-width: $message-box-mix-width;
    .aiui-dialog-body{
        position: relative;
        padding: $message-box-content-padding;
        color: $color-text-regular;
        font-size: $font-size-base;
    }
    @include m(icon){
        position: absolute;
        top: 50%;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        border-radius: 50%;
        color: #fff;
        @include m(info){
            background: $color-primary;
        }
        @include m(success){
            background: $color-success;
        }
        @include m(warning){
            background: $color-warning;
        }
        @include m(error){
            background: $color-danger;
        }
    }
    @include m(message){
        padding-left: 36px;
        padding-right: 12px;
    }
    .aiui-dialog-body{
        display: inline-block;
    }
}

.dialog-fade-enter-active {
  animation: dialog-fade-in .3s;
}

.dialog-fade-leave-active {
  animation: dialog-fade-out .3s;
}

@keyframes dialog-fade-in {
  0% {
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes dialog-fade-out {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }
}
  
  @keyframes aiui-modal-in {
    0% {
      opacity: 0;
    }
    100% {
    }
  }
  
  @keyframes aiui-modal-out {
    0% {
    }
    100% {
      opacity: 0;
    }
  }

  .aiui-modal-enter {
    animation: aiui-modal-in .3s ease;
  }
  
  .aiui-modal-leave {
    animation: aiui-modal-out .3s ease forwards;
  }